#!/bin/sh
#
# Prepare the commit message by adding a release note.

if [ -n "$2" ]; then
  exit 0
fi

old=$(sed -n '1!p' "$1")

cat > "$1" << EOF


Release note: None

# Write a commit message of the form
#
# <pkg>: <short description>
#
# Please add a release note with a category if your commit has user-facing
# changes. Leave the default above if not. For example,
#
# Release note (sql change): Add support for JSON columns.
#
# Categories.
# - cli change
# - sql change
# - admin ui change
# - general change (e.g., change of required Go version)
# - build change (e.g., compatibility with older CPUs)
# - enterprise change (e.g., change to backup/restore)
# - backwards-incompatible change
# - performance improvement
# - bug fix
EOF
echo "${old}" >> "$1"
